package com.sdgakj.interviews.job20180815;

import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Set;


public class AgeCal {

	public static void main(String[] args) {

		int age = 10+get(8);
		System.out.println(age);
		
		
		Hashtable<String,String> hashTable = new Hashtable<>();
		
		
		String str = "absd";
		
		try {
			String newStr = new String(str.getBytes("utf-8"),"gbk");
			System.out.println(newStr);
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		
		
		Charset charset = Charset.forName("gbk");
		CharsetDecoder newDecoder = charset.newDecoder();
		
		ByteBuffer by = ByteBuffer.allocate(48);
		CharBuffer ch = CharBuffer.allocate(48);
		newDecoder.decode(by,ch,false);
		
	}

	public static int get(int num) {
		return num <= 1 ? 2 : 2 + get(num - 1);
	}
	
	// 10 12 14 16 18 20 22 24 26 28 30
}
